<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/static/commons/taglibs.jsp"%>
<%@ include file="/static/commons/meta.jsp"%>
<%@ include file="/static/commons/jquery-easyui.jsp"%>
<html>
<head>
	<title>${title }</title>
	<link rel="stylesheet" href="${ctx }/static/styles/basic/basic.css" />
	<link rel="stylesheet" href="${ctx }/static/styles/frame/main.css" />
	<link rel="stylesheet" href="${ctx }/static/styles/frame/searchBtn.css" />
	<link rel="stylesheet" href="${ctx }/static/styles/frame/searchCondition.css" />
	<link rel="stylesheet" href="${ctx }/static/styles/template/template.css" />

	<object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
		<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
	</object>


	<script type="text/javascript" src="${ctx }/static/scripts/jquery.scrollto.js"></script>
	<!-- 检定结果通知书 -->
	<script type="text/javascript" src="${ctx}/static/widgets/lodop/LodopFuncs.js"></script>

</head>
<body onload="init()">
<input type="hidden" name="RequestVerificationToken" value="${RequestVerificationToken}" />

<!-- <div class="listFrame">
    <iframe name="listFrame" id="listFrame" frameBorder="0"
        scrolling="auto" style="width: 100%; height: 100%;"></iframe>
</div> -->
<div id="hero-slider">
	<ul>
		<div>
			<li><a href="#" rel="#panel-1" class="active" id="01">正面</a></li>
			<li><a href="#" rel="#panel-2" id="02">背面</a></li>
		</div>
		<li><a href="#" id="print" class="printImg">打印</a></li>
	</ul>
	<div class="mask">
		<div class="slider-body">
			<div class="panel" id="panel-1">
				<iframe id="listFrame_1" frameBorder="0" scrolling="auto" style="width: 100%; height: 100%;"></iframe>
			</div>
			<div class="panel" id="panel-2">
				<iframe id="listFrame_2" frameBorder="0" scrolling="auto" style="width: 100%; height: 100%;"></iframe>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
</body>
<script type="text/javascript">
    var headers = {};
    headers['__RequestVerificationToken'] = "${RequestVerificationToken}";
    function init() {
        set_iframe_h();
        $(window).resize(function() {
            set_iframe_h();
        });
        $('.easyui-combobox').combobox();
    }
    //设置ifream 高度
    function set_iframe_h() {
        var win_height  = $(window).height(),
            win_width = $(window).width();
        var func_line_h = $('.group_box').outerHeight(true),
            nav_width = $('#hero-slider ul').outerWidth(true);
        var list_height = win_height - func_line_h,
            list_width = win_width - nav_width;
        //$('.listFrame').css('height',list_height-10);
        $('#hero-slider ul').css('height',list_height-25);
        $('#hero-slider .panel').css('height',list_height-10);
        $('.mask').css({'height':list_height-10,'width':list_width-3});
    }

    $(function() {
		/* 	var $src = "${ctx}/static/template/检定结果通知书/检定结果通知书-CO.html";
		 $('#listFrame').attr('src', $src);

		 $('#template').on('change', function() {
		 $src = "${ctx}/static/template/检定结果通知书/" + this.value + ".html";
		 $('#listFrame').attr('src', $src);
		 }); */



        $('#hero-slider ul div a').click(function () {
            $('.customBlock ul div a').removeClass('active');
            $(this).addClass('active');
            $('.mask').scrollTo($(this).attr('rel'), 300);

            var id = this.id;
            if('01'==id){
                $(this).addClass('active');
                $('#02').removeClass('active');
            }else{
                $(this).addClass('active');
                $('#01').removeClass('active');
            }
            return false;
        });



        var $src = "${ctx}/template/";
        var frontUrl=$src+"showCertFront?orderId=${cert.order_id}&equId=${cert.equ_id}";
        var backUrl=$src+"showCertBack?orderId=${cert.order_id}&equId=${cert.equ_id}";

        $('#listFrame_1').attr('src', frontUrl);
        $('#listFrame_2').attr('src', backUrl);

//        $('#template').on('change', function(){
//            $('#listFrame_1').attr('src', frontUrl);
//            $('#listFrame_2').attr('src', backUrl);
//        });


        $("#print").click(function(){
            LODOP=getLodop();

            LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_同时打印俩网址");
            LODOP.ADD_PRINT_URL(0,20,"100%","100%",location.protocol+"//"+location.host+frontUrl);
            LODOP.ADD_PRINT_URL(1100,20,"100%","100%",location.protocol+"//"+location.host+backUrl);
            LODOP.SET_PRINT_STYLEA(0,"HOrient",2);
            LODOP.SET_PRINT_STYLEA(0,"VOrient",3);
            LODOP.SET_PRINT_MODE("PRINT_DUPLEX",2);//0-不控制 1-不双面 2-双面(长边装订) 3-小册子双面(短边装订_长边水平)
            LODOP.SET_PRINT_MODE("PRINT_DEFAULTSOURCE",1);//1-纸盒 4-手动 7-自动 0-不控制
            LODOP.SET_PRINT_MODE("DOUBLE_SIDED_PRINT",true);//如打印机无双面打印功能，也可手工实现，此时需true

            LODOP.PREVIEW();
        });

    });
</script>
</html>